package com.travel.user.service.impl;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.travel.user.dao.UserDao;
import com.travel.user.entity.User;
import com.travel.user.service.UserService;

/**
 * @classDesc: 功能描述:()
 * @author:<a href="leeue@foxmail.com">李月</a>
 * @Version:v1.0
 * @createTime:2019年2月24日 下午5:29:14
 */
@Service
@Transactional
public class UserServiceImpl implements UserService {

	@Autowired
	UserDao userDao;

	@Override
	public User findUser(String name, String password, String role) {

		return userDao.findByNameAndPasswordAndRole(name, password, role);
	}

	@Override
	public User saveUser(User user) {

		return userDao.save(user);
	}

	@Override
	public User findByName(String name) {
		return userDao.findByName(name);
	}

}
